<template>
  <div>
    <h3>这是coma的子组件comaSon</h3>
    <span>{{ name }}</span>
  </div>
</template>
<script>
import { Event } from '../../main';
export default {
  data() {
    return {
      name: ''
    };
  },
  created() {
    // 接收父组件传递过来的值
    Event.$on('comason', val => (this.name = val));
  }
};
</script>
<style lang="less" scoped>
div {
  span {
    color: red;
  }
}
</style>
